package com.atcumt.alibaba;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Test01 {

    public static void main(String[] args) throws NumberFormatException, IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int n =  Integer.parseInt(reader.readLine());
        int[] nums = Arrays.stream(reader.readLine().split(" ")).mapToInt(Integer::valueOf).toArray();
        Arrays.sort(nums);
        if (nums.length == 0 || nums == null) {
            System.out.println(0);
        }
        if (nums.length == 1) {
            System.out.println(1);
        }

        int maxLen = 1;
        int temp = nums[1] - nums[0];
        for (int i = 1; i < n; i++) {
            if (nums[i] - nums[i - 1] == temp) {
                maxLen++;
            }
            temp = nums[i] - nums[i - 1];
        }
        System.out.println(maxLen);
        reader.close();
    }
}
